package com.heima.behavior.controller;

import com.heima.behavior.dto.LikesBehaviorDto;
import com.heima.behavior.dto.UnLikesBehaviorDto;
import com.heima.behavior.entity.ApUnlikesBehavior;
import com.heima.behavior.service.ILikesBehaviorService;
import com.heima.behavior.service.IUnLikesBehaviorService;
import com.heima.common.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/unlikes_behavior")
public class UnLikesBehaviorController {

    @Autowired
    IUnLikesBehaviorService unLikesBehaviorService;

    /**
     * 不喜欢
     * @param dto
     * @return
     */
   @PostMapping
    public ResponseResult unLike (@RequestBody UnLikesBehaviorDto dto) {
       return unLikesBehaviorService.unLike(dto);
   }

    /**
     * 查询不喜欢
     * @param dto
     * @return
     */
   @PostMapping("getUnLikes")
    public ResponseResult<ApUnlikesBehavior> getUnLikes (@RequestBody UnLikesBehaviorDto dto) {
       return unLikesBehaviorService.getUnLikes(dto);
   }
}
